package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorMergeSequentialExample {
    public static void main(String[] args) {
        Flux<Integer> source1 = Flux.just(1, 2, 3);
        Flux<Integer> source2 = Flux.just(4, 5, 6);

        // 按顺序合并两个数据流
        Flux<Integer> mergedFlux = Flux.mergeSequential(source1, source2);

        mergedFlux.subscribe(System.out::println);
    }
}
